home *** CD-ROM | disk | FTP | other *** search
- Path: panther.Gsu.EDU!gs01bcm
- From: "Brian C. McDonald" <gs01bcm@panther.Gsu.EDU>
- Newsgroups: comp.lang.c
- Subject: HELP:(PLEASE) Checking bytes\PSP before execution?
- Date: Tue, 5 Mar 1996 23:25:15 -0500
- Organization: Georgia State University
- Message-ID: <Pine.SOL.3.91.960305231213.3998A-100000@panther.Gsu.EDU>
- NNTP-Posting-Host: panther.gsu.edu
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- NNTP-Posting-User: gs01bcm
-
-
- I want to check at least one or two bytes of a program so that,
- if the two bytes don't match up, the program won't run. I know that psp
- might be a good way to do this, but I cannot find much documentation on it.
-
- For example, I want to ensure that my pklited file won't run if it's
- uncompressed ... but the following line (recommended by PKWARE) doesn't
- seem to want to work:
-
- if (* (unsigned short int far *)MK_FP(_psp, 0x5C) != 0x4B50)
- {
- printf("Error in EXE."); //added by me
- exit(0); //added by me
- }
-
- When this is inserted in my "main" section, it always says "error in exe"
- when I run the executable, regardless of being pklite compressed or not.
-
- If anyone can help me, I will ... worship you for a few weeks. :)
-
- Thanks in advance,
- Brian
-